import java.util.Scanner;

public class HomeWork{
   public static int countSegments(String s){
       int segmentCount = 0;//该变量用来计数

       for (int i = 0;i < s.length();i++){
           if ((i == 0 || s.charAt(i - 1) == ' ') && s.charAt(i) != ' '){
           //(第一个下标对应的字符与空格后的第一个字符)与（不为空格的字符）
                segmentCount++;
           }
       }
       return segmentCount;
   }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        System.out.println(countSegments(s));
    }
}



